status: failed duration: 1.258s Captured stdout call zpk(z=2π·[], p=2π·[0.0], k=0.1) captured errors: args = (array([-3.18309886, -3.1662616 , -3.1495134 , -3.13285379, -3.11628231, -3.09979848, -3.08340184, -3.06709194,...21061, -0.03303494, -0.03286019, -0.03268638, -0.03251348, -0.0323415 , -0.03217042, -0.03200026, -0.03183099])) kwds = {'decimal': 7} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) /opt/conda/lib/python3.12/contextlib.py:81: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /opt/conda/lib/python3.12/contextlib.py:81: in inner return func(*args, **kwds) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (.compare at 0x7f6877be27a0>, array([-3.18309886, -3.1662616 , -3.1495134 ...21061, -0.03303494, -0.03286019, -0.03268638, -0.03251348, -0.0323415 , -0.03217042, -0.03200026, -0.03183099])) kwds = {'err_msg': '', 'header': 'Arrays are not almost equal to 7 decimals', 'precision': 7, 'verbose': True} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Arrays are not almost equal to 7 decimals E E Mismatched elements: 1000 / 1000 (100%) E Max absolute difference: 3.18309886 E Max relative difference: 0.5 E x: array([-3.1830989, -3.1662616, -3.1495134, -3.1328538, -3.1162823, E -3.0997985, -3.0834018, -3.0670919, -3.0508683, -3.0347305, E -3.018678 , -3.0027105, -2.9868274, -2.9710283, -2.9553128,... E y: array([-6.3661977, -6.3325232, -6.2990268, -6.2657076, -6.2325646, E -6.199597 , -6.1668037, -6.1341839, -6.1017366, -6.069461 , E -6.0373561, -6.005421 , -5.9736548, -5.9420567, -5.9106257,... /opt/conda/lib/python3.12/contextlib.py:81: AssertionError During handling of the above exception, another exception occurred: zpk = ((), (0,), 0.1) @pytest.mark.parametrize('zpk', [ ((0,), (), 0.1), ((), (0,), 0.1), ((-1,), (), 0.1), ((), (-1,), 0.1), ((0, 0,), (10, 10), 0.1), ((10, 10), (0, 0), 0.1), ((-1, -1,), (10, 10), 0.1), ((10, 10), (-1, -1), 0.1), ((0, ), (10, 10), 0.1), ((10, 10), (0,), 0.1), ((-1, ), (10, 10), 0.1), ((10, 10), (-1, ), 0.1), ]) def test_ZPK_various(zpk): """ Test the conversions to and from ZPK representation and statespace representation using a delay filter """ delta_t = 1 axB = mplfigB(Nrows=2) F_Hz = logspaced(0.01 / delta_t, 2 / delta_t, 1000) filt = SISO.zpk(zpk, fiducial_rtol=1e-7) print(filt) xfer1 = filt.fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer1), label="Direct ZPK") axB.ax1.plot(F_Hz, np.angle(xfer1, deg=True)) xfer2 = (filt * filt).fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer2), label="ZPK self product") axB.ax1.plot(F_Hz, np.angle(xfer2, deg=True)) filt_ss = filt.asSS * 4 filt_ssi = 1/filt_ss xfer3 = filt_ss.fresponse(f=F_Hz).tf xfer3b = filt_ssi.fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer3) / 4, label="ZPK2SS") axB.ax1.plot(F_Hz, np.angle(xfer3, deg=True)) axB.ax0.semilogx(F_Hz, abs(1/xfer3b) / 4, label="ZPK2SS inv") axB.ax1.plot(F_Hz, np.angle(1/xfer3b, deg=True)) filt_zpk = filt_ss.asZPK filt_zpki = filt_ssi.asZPK xfer4 = filt_zpk.fresponse(f=F_Hz).tf xfer4b = (1/filt_zpk).fresponse(f=F_Hz).tf xfer4c = (filt_zpki).fresponse(f=F_Hz).tf axB.ax0.semilogx(F_Hz, abs(xfer4) / 4, label="SS2ZPK") axB.ax1.plot(F_Hz, np.angle(xfer3, deg=True)) axB.ax0.semilogx(F_Hz, abs(1/xfer4b) / 4, label="SS2ZPK inv") axB.ax1.plot(F_Hz, np.angle(1/xfer4b, deg=True)) axB.ax0.semilogx(F_Hz, abs(1/xfer4c) / 4, label="SS2ZPK ss inv") axB.ax1.plot(F_Hz, np.angle(1/xfer4c, deg=True)) axB.ax0.legend() axB.save(tjoin("test_ZPK")) np.testing.assert_almost_equal(xfer2, xfer1**2) > np.testing.assert_almost_equal(xfer3, 4 * xfer1) ../../src/wield/control/SISO/test/test_SISO_delay.py:219: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (array([0.-3.18309886j, 0.-3.1662616j , 0.-3.1495134j , 0.-3.13285379j, 0.-3.11628231j, 0.-3.09979848j, 0.-3.08....-0.03286019j, 0.-0.03268638j, 0.-0.03251348j, 0.-0.0323415j , 0.-0.03217042j, 0.-0.03200026j, 0.-0.03183099j])) kwds = {} @wraps(func) def inner(*args, **kwds): with self._recreate_cm(): > return func(*args, **kwds) E AssertionError: E Arrays are not almost equal to 7 decimals E ACTUAL: array([0.-3.18309886j, 0.-3.1662616j , 0.-3.1495134j , 0.-3.13285379j, E 0.-3.11628231j, 0.-3.09979848j, 0.-3.08340184j, 0.-3.06709194j, E 0.-3.0508683j , 0.-3.03473048j, 0.-3.01867803j, 0.-3.00271049j,... E DESIRED: array([0.-6.36619772j, 0.-6.3325232j , 0.-6.2990268j , 0.-6.26570759j, E 0.-6.23256461j, 0.-6.19959696j, 0.-6.16680368j, 0.-6.13418387j, E 0.-6.1017366j , 0.-6.06946097j, 0.-6.03735606j, 0.-6.00542097j,... /opt/conda/lib/python3.12/contextlib.py:81: AssertionError